package com.chukun.interview.feature.inf.impl;

import com.chukun.interview.feature.inf.base.Shape;

/**
 * 存在并发修改半径问题
 */
public class Circle01 implements Shape {

    private double radius;

    public Circle01(double radius) {
        this.radius = radius;
    }

    @Override
    public  double getArea() {
        return 0;
    }

    public double getRadius() {
        return radius;
    }

    // 提供setter方法，就意味着此半径可以被修改，会有并发问题
    public void setRadius(double radius) {
        this.radius = radius;
    }

}